package com.bioroadlab.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.bioroadlab.pojo.Patient;

@Repository
public class PatientDao extends BaseDao<Patient, Integer> {

	@SuppressWarnings("unchecked")
	public List<Patient> findByName(String term) {
		String hql = "from Patient where name like '%" + term + "%'";
		Query query = getSession().createQuery(hql);
		return query.list();
	}

}
